<?php


namespace app\api\controller\mall;


use app\api\controller\ApiBase;
use app\common\business\Goods;
use app\common\lib\Show;

class Detail extends ApiBase
{
    public function index()
    {
        $id = input('id', 0, 'intval');

        if (!$id) {
            return Show::error();
        }
        $goods = (new Goods())->getGoodsDetailBySkuId($id);

        if (!$goods) {
            return Show::error();
        }
        return Show::success($goods);
    }
}